package com.base.home.adapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.base.commonlib.recy.BaseHolderType;
import com.base.commonlib.recy.BasicRecyViewHolder;
import com.base.home.HomeConfig;
import com.base.home.R;
import com.base.home.bean.TitleBean;

/**
 * 在此写用途
 *
 * @version V1.0 <描述当前版本功能>
 *          Created by admin on 2018/5/22.
 * @FileName: com.zhongyue.mdchengguan.ui.main.adapter.CategoryViewHolder.java
 * Author weikailiang
 * @date: 2018-05-22 14:22
 */
public class TitleViewHolder extends BaseHolderType<TitleBean,TitleViewHolder.titleViewHolder> {

    @Override
    public int getType(TitleBean titleBean) {
        return HomeConfig.TYPE_TITLE;
}

    @Override
    public void bindDataToHolder(final titleViewHolder holder, TitleBean bean, int postion) {
        holder.mTvName.setText(bean.getName());
    }



    @Override
    public titleViewHolder buildHolder(ViewGroup parent) {
        return new titleViewHolder(View.inflate(parent.getContext(), R.layout.item_home_title, null));
    }



    public static class titleViewHolder extends BasicRecyViewHolder {
        private TextView mTvName;
        public titleViewHolder(View itemView) {
            this(itemView, null, null);
            mTvName = itemView.findViewById(R.id.tv_name);
        }
        public titleViewHolder(View itemView, OnItemClickListener clickListener, OnItemLongClickListener longClickListener) {
            super(itemView, clickListener, longClickListener);
        }
    }
}
